import dva from 'dva';
import createLoading from 'dva-loading'
import { message } from 'antd'
import createHistory from 'history/createHashHistory'
import './index.css';
import 'babel-polyfill'

// 1. Initialize
const app = dva({
  ...createLoading({
    effects: true
  }),
  history: createHistory(),
  onError (error) {
    message.error(error.message)
  },
});

// 2. Plugins
// app.use({});

// 2. Model
app.model(require('./models/app').default)

// 3. Router
app.router(require('./router').default)

// 4. Start
app.start('#root')
